/* 全局样式 */
:root {
  --primary-color: #3B71CA;
  --secondary-color: #6c757d;
  --success-color: #14A44D;
  --danger-color: #DC4C64;
  --warning-color: #E4A11B;
  --info-color: #54B4D3;
  --light-color: #f8f9fa;
  --dark-color: #212529;
}

body {
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* 卡片悬停效果 */
.card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

/* 书籍封面样式 */
.book-cover {
  height: 200px;
  object-fit: cover;
  border-radius: 4px;
}

/* 评分星星 */
.rating {
  color: #f8c01d;
}

/* 标签样式 */
.badge-category {
  background-color: var(--info-color);
  color: white;
  font-weight: normal;
  padding: 0.35em 0.65em;
  border-radius: 0.25rem;
  text-decoration: none;
  margin: 0.1rem;
  display: inline-block;
}

/* 颜色标签 */
.color-tag {
  width: 15px;
  height: 15px;
  display: inline-block;
  border-radius: 50%;
  margin-right: 5px;
}

/* 书单列表 */
.booklist-card {
  border-left: 4px solid var(--primary-color);
}

/* 加载动画 */
.loader {
  border: 5px solid rgba(0, 0, 0, 0.1);
  border-radius: 50%;
  border-top: 5px solid var(--primary-color);
  width: 50px;
  height: 50px;
  animation: spin 1s linear infinite;
  margin: 20px auto;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* 自定义分页 */
.page-link {
  color: var(--primary-color);
}

.page-item.active .page-link {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

/* 评论区 */
.comment-bubble {
  background-color: #f0f2f5;
  border-radius: 18px;
  padding: 10px 15px;
  margin-bottom: 10px;
}

[data-bs-theme="dark"] .comment-bubble {
  background-color: #2a2d31;
}

/* 搜索结果高亮 */
.highlight {
  background-color: rgba(255, 193, 7, 0.2);
  padding: 0 2px;
  border-radius: 2px;
}

/* 响应式调整 */
@media (max-width: 768px) {
  .book-cover {
    height: 150px;
  }
  
  .navbar .form-control {
    width: 150px;
  }
}

/* 暗黑模式特定样式 */
[data-bs-theme="dark"] {
  --bs-body-bg: #121212;
  --bs-body-color: #f8f9fa;
}

[data-bs-theme="dark"] .navbar {
  background-color: #1d2025 !important;
}

[data-bs-theme="dark"] .card {
  background-color: #1d2025;
  border-color: #2d3237;
}

[data-bs-theme="dark"] .modal-content {
  background-color: #1d2025;
  border-color: #2d3237;
}

[data-bs-theme="dark"] .page-link {
  background-color: #1d2025;
  border-color: #2d3237;
}

/* 上传书籍区域 */
.upload-area {
  border: 2px dashed #ced4da;
  padding: 2rem;
  text-align: center;
  border-radius: 5px;
  cursor: pointer;
  transition: border-color 0.3s;
}

.upload-area:hover {
  border-color: var(--primary-color);
}

/* 书籍详情页 */
.book-detail-cover {
  max-height: 300px;
  object-fit: contain;
}

/* 用户头像 */
.avatar-preview {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--primary-color);
}

/* 徽章 */
.badge-count {
  position: absolute;
  top: -8px;
  right: -8px;
  font-size: 0.6rem;
}

/* 实用工具类 */
.cursor-pointer {
  cursor: pointer;
}

.text-truncate-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.text-truncate-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
} 